package PierrePapierCiseaux;

import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;



@Test
public class TestPierrePapierCiseaux {
	PierrePapierCiseaux rps;


	@BeforeClass
	void setUpClass()
	{
		rps = new PierrePapierCiseaux();
	}

	@AfterClass
	void tearDownClass()
	{
		rps = null;
	}
	
	
	@DataProvider(name = "failed")
	public Object[][] createFailedData() {
	 return new Object[][] {
	   { "ROCK", "PAPER" },
	   { "PAPER", "SCISSORS" },
	   { "SCISSORS", "SCISSORS" },
	 };
	}

	
/*	@Parameters({ "PAPER", "ROCK" })
	@Test
	void testWinPlay(@Optional("PAPER") String p1, @Optional("ROCK") String p2)
	{
		Assert.assertEquals(rps.play(RPSEnum.valueOf(p1), RPSEnum.valueOf(p2)),Result.WIN);
	}*/
	
	
	@Test(dataProvider = "failed")
	void testWinFail(String p1, String p2)
	{
		Assert.assertEquals(rps.play(RPSEnum.valueOf(p1), RPSEnum.valueOf(p2)),Result.LOST);
	}

}